package com.zyx.reward.server.model.response;

import cn.hutool.http.HttpStatus;

/**
 * 枚举常用Response操作码
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(HttpStatus.HTTP_OK, "操作成功!"),
    FAILED(HttpStatus.HTTP_INTERNAL_ERROR, "操作失败!"),

    AUTHENTICATION_FAILED(50001, "获取token失败!"),
    AUTH_SERVER_ERROR(50002, "授权服务异常!"),
    LOGIN_METHOD_IS_EMPTY(50003, "登录方式不能为空!"),
    LOGIN_METHOD_IS_INVALID(50004, "登录方式只支持password模式!"),

    UNAUTHORIZED(40001, "身份认证失败!"),
    VALIDATE_FAILED(40002, "Token参数校验失败,请检查Token是否正确!"),
    FORBIDDEN(40003, "无权限请求,请检测当前用户身份信息!"),
    ACCOUNT_IS_EMPTY(40004, "账号不能为空!"),
    PASSWORD_IS_EMPTY(40005, "密码不能为空!"),

    XXLJOB_ADD_APISUCCESS(HttpStatus.HTTP_OK, "操作成功!"),
    SYNC_JOB_ID_NULL(41001, "同步任务id不能为空!"),
    SYNC_JOB_NOT_EXISTS(41001, "同步任务不存在或者已删除!"),
    XXLJOB_ADD_APIERROR(42001, "调用xxljob调度中心添加任务接口添加任务失败!"),
    XXLJOB_ADD_DUPLICATION(42002, "xxljob调度中心任务重复添加!"),
    XXLJOB_UPDATE_APISUCCESS(HttpStatus.HTTP_OK, "xxljob调度中心更新任务操作成功!"),
    XXLJOB_UPDATE_APIERROR(43001, "xxljob调度中心更新任务失败!"),
    XXLJOB_UPDATE_DUPLICATION(43002, "xxljob调度中心更新时参数重复!"),
    XXLJOB_START_APISUCCESS(HttpStatus.HTTP_OK, "xxljob调度中心启用任务操作成功!"),
    XXLJOB_START_APIERROR(44001, "xxljob调度中心启用任务失败!"),
    XXLJOB_HAS_STARTED(44002, "当前调度任务在xxljob调度中心已经启动!"),
    XXLJOB_STOP_APISUCCESS(HttpStatus.HTTP_OK, "xxljob调度中心停止任务操作成功!"),
    XXLJOB_STOP_APIERROR(45001, "xxljob调度中心停止任务失败!"),
    XXLJOB_HAS_STOPPED(44002, "当前调度任务在xxljob调度中心已经停止!"),

    REFRESH_TOKEN_NOT_EXIST(60001, "刷新令牌值不能为空!"),
    PARAM_IS_INVALID(60002, "参数校验失败!"),
    PARAMS_REQUEST_VALIDATE_FAIL(60003, "请求参数错误!");

    /**
     * 消息码
     */
    private final Integer code;
    /**
     * 消息体
     */
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
